import { ref } from "vue";
import type { AvueFormOption } from "@smallwei/avue";

export default function () {
  const option: AvueFormOption = {
    menuBtn: false,
    labelWidth: 110,
    column: [
      {
        type: "tree",
        prop: "parentId",
        label: "上级部门",
        span: 24,
        dicUrl: "/api/system/dept/treeList",
        props: {
          label: "deptName",
          value: "id",
        },
      },
      {
        prop: "deptName",
        label: "部门名称",
        rules: [
          {
            required: true,
            message: "请输入部门名称",
          },
        ],
      },
      {
        type: "number",
        prop: "orderNum",
        label: "显示排序",
      },
      {
        prop: "leader",
        label: "负责人",
      },
      {
        prop: "phone",
        label: "联系电话",
      },
      {
        prop: "email",
        label: "邮箱",
      },
      {
        type: "select",
        prop: "status",
        label: "状态",
        dicUrl: "/api/system/dict/type/optionSelect/sys_status",
        props: {
          label: "dictLabel",
          value: "dictValue",
        },
      },
    ],
  };
  return ref(option);
}
